package com.kkw.shoppingmall.cart.config;



/**
 * @author Kevin
 * @date 2021-02-22 2:19 下午
 * @description sentinel自定义返回方法
 */
//@Configuration
//public class MySeckillSentinelConfig {
//
//    public MySeckillSentinelConfig() {
//        WebCallbackManager.setUrlBlockHandler(new UrlBlockHandler() {
//            @Override
//            public void blocked(HttpServletRequest request, HttpServletResponse response, BlockException e) throws IOException {
//                R r = R.error(BizCodeEnume.TO_MANY_REQUEST.getCode(), BizCodeEnume.TO_MANY_REQUEST.getMsg());
//                //解决response乱码
//                response.setCharacterEncoding("utf-8");
//                response.setContentType("application/json");
//                response.getWriter().write(JSON.toJSONString(r));
//            }
//        });
//    }
//}
